const validator = {
    isString: (obj) => {
        return Object.prototype.toString.call(obj) === "[object String]";
    },
    isNumber: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Number]";
    },
    isBoolean: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Boolean]";
    },
    isArray: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Array]";
    },
    isObject: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Object]";
    },
    isFunction: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Function]";
    },
    isRegExp: (obj) => {
        return Object.prototype.toString.call(obj) === "[object RegExp]";
    },
    isDate: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Date]";
    },
    isUndefined: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Undefined]";
    },
    isNull: (obj) => {
        return Object.prototype.toString.call(obj) === "[object Null]";
    },
    isBlankStr: (obj) => {
        return validator.isString(obj) && obj.trim() === "";
    },
    isEmpty: (obj) => {
        return validator.isUndefined(obj) || validator.isNull(obj) || validator.isBlankStr(obj);
    },
}

export default validator;